package main

func halvesAreAlike(s string) bool {
	n := len(s)
	a, b := s[:n/2], s[n/2:]
	m := map[byte]struct{}{
		'a': {},
		'e': {},
		'i': {},
		'o': {},
		'u': {},
		'A': {},
		'E': {},
		'I': {},
		'O': {},
		'U': {},
	}

	aCnt, bCnt := 0, 0
	for i := 0; i < len(a); i++ {
		if _, has := m[a[i]]; has {
			aCnt++
		}
	}
	for i := 0; i < len(b); i++ {
		if _, has := m[b[i]]; has {
			bCnt++
		}
	}
	return aCnt == bCnt
}
